import axios from 'axios'

export function login(data) {
  return axios.post('/api/user/login', data).then(res => res.data)
}

export function register(data) {
  return axios.post('/api/user/register', data).then(res => res.data)
}

export function getUserInfo(userId) {
  return axios.get(`/api/user/info?userId=${userId}`).then(res => res.data)
}

export function updateUserInfo(data) {
  return axios.put('/api/user/update', data).then(res => res.data)
}

export function getUserList() {
  return axios.get('/api/user/list').then(res => res.data)
}

export function deleteUser(userId) {
  return axios.delete(`/api/user/delete?userId=${userId}`).then(res => res.data)
} 